//
//  BIDNoticeKindViewController.m
//  JuanChengOA
//
//  Created by mal on 2017/7/19.
//  Copyright © 2017年 mal. All rights reserved.
//

#import "BIDNoticeKindViewController.h"
#import "BIDMeetingListViewController.h"
#import "BIDActivityListViewController.h"
#import "BIDAnnouncementListViewController.h"

@interface BIDNoticeKindViewController ()

@end

@implementation BIDNoticeKindViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.title = @"通知公告";
    _menuArr = @[@{@"title":@"会议管理", @"imgName":@"noticeManage.png"},
                 @{@"title":@"活动管理", @"imgName":@"activityManage.png"},
                 @{@"title":@"公告管理", @"imgName":@"announcementManage.png"}];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
    
- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    [self refreshBadge];
}
    
- (void)pushNotificationHandler
{
    [self refreshBadge];
}
    
    //刷新角标
- (void)refreshBadge
{
    NSString *strPost = [[NSString alloc] initWithFormat:@"userId=%@", [AppDelegate getUserId]];
    NSDictionary *dictionary1 = @{@"index":@0, @"url":@"noticeAndroid!checkNew.action", @"param_request":strPost, @"param_response":@"recvNotRead"};
    NSDictionary *dictionary2 = @{@"index":@1, @"url":@"noticeAndroid!gainNotReadActivity.action", @"param_request":strPost, @"param_response":@"activityNotRead"};

    NSArray *arr = [[NSArray alloc] initWithObjects:dictionary1, dictionary2, nil];
    [self getCornerMarkCount:arr];
}

- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
{
    NSUInteger index = [indexPath row];
    UIViewController *vc = nil;
    switch (index)
    {
        case 0:
        {
            //会议管理
            vc = [[BIDMeetingListViewController alloc] init];
        }
        break;
        case 1:
        {
            //活动管理
            vc = [[BIDActivityListViewController alloc] init];
        }
        break;
        case 2:
        {
            //公告管理
            vc = [[BIDAnnouncementListViewController alloc] init];
        }
        break;
    }
    if(vc)
    {
        [self.navigationController pushViewController:vc animated:YES];
    }
}

@end
